package spinal_loongarch_core132

import spinal.core._
import spinal.lib._

object MuxOH0{
    def apply[T <: Data](oh:IndexedSeq[Bool],dats:Iterable[T]):Bits = {
        apply(oh,Vec(dats))
    }
    def apply[T <: Data](oh:IndexedSeq[Bool],dats:Vec[T]):Bits = {
        (for(i <- 0 until oh.length) yield Mux(oh(i),dats(i).asBits,B(0))).reduce(_|_)
    }
}
